UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'co5Ko9y0X1VaxOVcyKRqyP7kXtx03Xyridf5LsckyLY='
WHERE
key_id = 'caa3a0099c30ad2faec46c6e005f6193101af1fbbd75c881e2422e32706079b2'
AND (
token = 'co5Ko9y0X1VaxOVcyKRqyP7kXtx03Xyridf5LsckyLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)