UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jwT1fgaKrhs5t9yr+72wYxggclCiAPb7ssOTAJBQofs=' 
WHERE 
  key_id = '5fcc70b8d4cb5780fe1d547b5e9c5f86f4339149bfe062bed18a80ceace2d5c3' 
  AND (
    token = 'jwT1fgaKrhs5t9yr+72wYxggclCiAPb7ssOTAJBQofs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019