UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KBduH+oX7awWEuuxgzhK8c6YgOBNXYXuK5xIw1MFa/I=' 
WHERE 
  key_id = 'bbd1ec2ffcd58b47b7860f51c05796dc4a67f265b50ccf002037ea2171fea71b' 
  AND (
    token = 'KBduH+oX7awWEuuxgzhK8c6YgOBNXYXuK5xIw1MFa/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057