UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zxt41FGPsmMmDFLO/qQhnN+g5suVfU40EF0V5lCHofc=' 
WHERE 
  key_id = '93a6bbfe4b1ee50c784db5deb0f5705bc7af3fcd409a613378560b6e09ce51a0' 
  AND (
    token = 'zxt41FGPsmMmDFLO/qQhnN+g5suVfU40EF0V5lCHofc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017