UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H/PGrTq5HKwZCrrwwCq81hBN19TJL/y1A1N3xUDj8Zg=' 
WHERE 
  key_id = 'e60d1618d01d95cd73b7f7a0055a4f596bbf8c191c6d2f77468f411315d49b20' 
  AND (
    token = 'H/PGrTq5HKwZCrrwwCq81hBN19TJL/y1A1N3xUDj8Zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020