UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykRgT9y0q8yipJayhuqe3cIFSQ2WXmLF3IkBUqdA/PI='
WHERE
key_id = 'f4b1c0f02e8274829d9c9b9371500fbc7bebf27ed7a122cf72cad20910dbf6b6'
AND (
token = 'ykRgT9y0q8yipJayhuqe3cIFSQ2WXmLF3IkBUqdA/PI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)