UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/2rvVbCNYB/SbMeuClduyQ/G8ZMfHgK3zYMzr2jm3ho=' 
WHERE 
  key_id = 'ed58efe566676b652028da935430a4fb079632d4e0553a3aac629ad946a8cc36' 
  AND (
    token = '/2rvVbCNYB/SbMeuClduyQ/G8ZMfHgK3zYMzr2jm3ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037