UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oAf22VlD2fmN3FzGl3rlaGa2leg2GLqKhzESXC/FX84='
WHERE
key_id = 'c7a8ea5329d3aaa6b190ad1005fa3dbd95bad561885acb9a45e5b1793f1177b1'
AND (
token = 'oAf22VlD2fmN3FzGl3rlaGa2leg2GLqKhzESXC/FX84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)