UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sczMNgJJxKo37vuMHz4vPOXJoeZXwAVTSwIrKQAL338=' 
WHERE 
  key_id = '81cb982ef81c33cc51bfdb695042be2f2be985d20d19fb6ea1206c0f6ce6945d' 
  AND (
    token = 'sczMNgJJxKo37vuMHz4vPOXJoeZXwAVTSwIrKQAL338=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015