UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BUyQdf7kSKSvlwRf9g2nTlsaIn2oePLhyTGwiqQ/nh8=' 
WHERE 
  key_id = '44b6f60a1297da7b8143bd299ca4620bfff4e2690e0f423dc1f17744e1eec94e' 
  AND (
    token = 'BUyQdf7kSKSvlwRf9g2nTlsaIn2oePLhyTGwiqQ/nh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034