UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fGvjzU/Nl+aUEc2oP7q00DTJ/B2PrIkl60eCNKW/QAc=' 
WHERE 
  key_id = 'aef88e90223b738a022466a0914cb3fe2233b2454afca2bc9cf4bd60de9f1cb0' 
  AND (
    token = 'fGvjzU/Nl+aUEc2oP7q00DTJ/B2PrIkl60eCNKW/QAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059