UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BR7EWDFoU3YPl4oHaUpg5RE+ctzSWZYu6/Yv9DuteWg=' 
WHERE 
  key_id = 'c6ecc190f5953a4dcdc1fdd88418dcb6063a35615c5aa3a932a9e16682067933' 
  AND (
    token = 'BR7EWDFoU3YPl4oHaUpg5RE+ctzSWZYu6/Yv9DuteWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037