UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jaXpVmWFddFtqM+ZrvZSPi5a7Z+xcVQB7VnN6yi4kUg='
WHERE
key_id = '6d8379c40698bf4bf58db710dc0b74fe8ba22092e76872c34ba83cb7c3de01f0'
AND (
token = 'jaXpVmWFddFtqM+ZrvZSPi5a7Z+xcVQB7VnN6yi4kUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)