UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UuD6F+rniNj1dPN3gB7m7YKp26RkzM6rHWM6M4TSxf0='
WHERE
key_id = 'f6734ab3d020de143c7cdf7999eefa20717b6dd33ddece1b7844212638acb321'
AND (
token = 'UuD6F+rniNj1dPN3gB7m7YKp26RkzM6rHWM6M4TSxf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)