UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8o7xR6RZxkuE2cQXzCN1bmq2XzEXLW4PkJWdMWX6+b8='
WHERE
key_id = 'e1fddcdd369447e57ac4c08fae49acdd90ca33091edca4eb95aa1f2f7aad1c3b'
AND (
token = '8o7xR6RZxkuE2cQXzCN1bmq2XzEXLW4PkJWdMWX6+b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)