UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1rCoW0JEKg9OIHP69IqYyfXSEhRN77+7UigQ8e041pQ='
WHERE
key_id = '6c286208c7cddaa18121af7516331db0dbd6bb77c7263797a1d9af5f83dc898b'
AND (
token = '1rCoW0JEKg9OIHP69IqYyfXSEhRN77+7UigQ8e041pQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)