UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sN2BseNrRFgH02iNNx+A06tmiFmuFpQ7tfryp5ND6e0=' 
WHERE 
  key_id = '7ffb46bc8a02ffc77bfeda1b7436e0dd5a442761bdcdc8b81c245268a2f7c152' 
  AND (
    token = 'sN2BseNrRFgH02iNNx+A06tmiFmuFpQ7tfryp5ND6e0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033