UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Q0ILd7gyfj4e5cvvS8QbSqUndMEK8uSSTp8AAvrBqA=' 
WHERE 
  key_id = '5d020759a8b9c1a8c085b99d73149c4b84fa9f00ee5e6dc9b76861aaf2b8db1a' 
  AND (
    token = '+Q0ILd7gyfj4e5cvvS8QbSqUndMEK8uSSTp8AAvrBqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050