UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FAITD5S94HVxszo89q2yp//5lrBX4hXIYgjzFt0lO9I=' 
WHERE 
  key_id = '3504f7a672fd2d9b6127b94fd462d595523b8dd62251ee7cd8d5c6923c1da841' 
  AND (
    token = 'FAITD5S94HVxszo89q2yp//5lrBX4hXIYgjzFt0lO9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051