UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OW/lKUJaux8WxH7VaWZJV3T25D5g8KroFWcQhiOGTog=' 
WHERE 
  key_id = 'a2cdfa42c5a4c4de8ea772f485a48e4924b15e02cceaa01c25b1d3006a01aa25' 
  AND (
    token = 'OW/lKUJaux8WxH7VaWZJV3T25D5g8KroFWcQhiOGTog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029