UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hM2X6cSPJGkQ2MjBz8jtensfI/tQocQm7TJnHm9PB7I=' 
WHERE 
  key_id = '5fee82d0f45e354cb927606a8bd1cebcde18962f39ef490faab95c65e7da306f' 
  AND (
    token = 'hM2X6cSPJGkQ2MjBz8jtensfI/tQocQm7TJnHm9PB7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031