UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XIqnyCFh2vboOya9U64mdetq9hXypn2SwJXRb/c75og='
WHERE
key_id = 'f6c2b92d7e8ff075e9e07eafa905a4c78bf0949d19389901f52683223ea12848'
AND (
token = 'XIqnyCFh2vboOya9U64mdetq9hXypn2SwJXRb/c75og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)