UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tynR91Pup1wRkvMXDmM4TlxaqAwyc4oO6oCWR+wZqXE='
WHERE
key_id = 'f5377af928307d6b3987c67092b2675e1387d7ea6275eaa8bab187b687070991'
AND (
token = 'tynR91Pup1wRkvMXDmM4TlxaqAwyc4oO6oCWR+wZqXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)