UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MP2SP9bh25KowZe/hbf4A5M9FawWekR6wsSpqU1zXlI=' 
WHERE 
  key_id = 'bfa57caddbd8ed8bdb85e85973329150abe54f64ec319fa1ff003874e46179ad' 
  AND (
    token = 'MP2SP9bh25KowZe/hbf4A5M9FawWekR6wsSpqU1zXlI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042