UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJRwa1uHRzwy4EfGvpfjTW+fsuAJXI2axKNcEjWlaT8='
WHERE
key_id = '5280ac093e73e862495a9eb5b29d7227d8ff86580bdc8ff2ec88c9426ac187aa'
AND (
token = 'mJRwa1uHRzwy4EfGvpfjTW+fsuAJXI2axKNcEjWlaT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)