UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/y4YJkPrDdaFgCMd+4ecOCd1v2cKMePJlQhdL5hUQlE='
WHERE
key_id = 'd423f4a0ae9267be5afaf69668fad7ca61004d067672da88ee1c3427b93dccc3'
AND (
token = '/y4YJkPrDdaFgCMd+4ecOCd1v2cKMePJlQhdL5hUQlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)