UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KZDnT2KnOfMUzCYVF78cY9HQrF+QIJ75yxoGYlIholU='
WHERE
key_id = '301d6c83d48b3e2d725f30c29240103cc2633c3ed591debfd10b71ae5f5db568'
AND (
token = 'KZDnT2KnOfMUzCYVF78cY9HQrF+QIJ75yxoGYlIholU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)