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