UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dx8ZnipjuGcvunvhVq+alW1UKC2DFbaldA6Uf5BRmkA='
WHERE
key_id = '3808688c8673325281d623703f54f129151bf807168cf30933bc170a30c45f4a'
AND (
token = 'Dx8ZnipjuGcvunvhVq+alW1UKC2DFbaldA6Uf5BRmkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)