UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RU3V4WHedDYbI5x1ZASC0kgV6l4xQo7EnPXeO/l3diw='
WHERE
key_id = 'a0453c4e00ad55bf15319f30a5a0701c06bc60c10c12bcbafd4fa82a552ea0db'
AND (
token = 'RU3V4WHedDYbI5x1ZASC0kgV6l4xQo7EnPXeO/l3diw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)