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