UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGrWUWUw26AXCCynoQ+98KzVL88oTaG5yl2O+h0xSrc='
WHERE
key_id = '3518626512ca1a0c25b2441e8afd34eba7ea6128752ee78aba89686f5904a226'
AND (
token = 'sGrWUWUw26AXCCynoQ+98KzVL88oTaG5yl2O+h0xSrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)