UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0+3kutQR3drYIOvgtQQUSyujbGYXVUFxfoShG16hNJI=' 
WHERE 
  key_id = 'd6be233b1240a772af8f0d1f84c6687e6047691a7aa78a97c68d677f83c230f6' 
  AND (
    token = '0+3kutQR3drYIOvgtQQUSyujbGYXVUFxfoShG16hNJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059