UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UeWkzG/nzQOhGFlT6vwBPLmFeuRISHZW6x7TWu6qKFc='
WHERE
key_id = 'cfddd7d1cda75dff2dfaf7a243e5677b6353283a0bd248aa5a8320d84c3e4384'
AND (
token = 'UeWkzG/nzQOhGFlT6vwBPLmFeuRISHZW6x7TWu6qKFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)