UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x10PVb6T5W2NcbwnJr/Y/m3Thc+b5/wT8WcdZITYiaI=' 
WHERE 
  key_id = '55a6693aaa29083b55fe01859753347148f95d020345feaa3ca3394fdd5fb341' 
  AND (
    token = 'x10PVb6T5W2NcbwnJr/Y/m3Thc+b5/wT8WcdZITYiaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028