UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HxqYUGRVBSu5ybQqC8LCCgzHK3prrryzuienEQCpuM='
WHERE
key_id = '38a8bfae9bf526191e96ee94886f98132f6873310b81d47938de4ccf07055a19'
AND (
token = '5HxqYUGRVBSu5ybQqC8LCCgzHK3prrryzuienEQCpuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)