UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uf0xr08LwGcIApWj7ucMY3uG7nZFUmUuyuN/t3SJW3Q='
WHERE
key_id = 'cccfefa996d783eac51eb37bd57b784af6aeb44c0132fe959c2370ad87f12335'
AND (
token = 'Uf0xr08LwGcIApWj7ucMY3uG7nZFUmUuyuN/t3SJW3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)