UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XUYa0/GDQlOuTu5z5eSwOGb6DfXuMDCTlR7pRsO5YbI=' 
WHERE 
  key_id = '0934df88c70f780568c5eecf809f78f801a8b392970143b6469b90a1ede4cde3' 
  AND (
    token = 'XUYa0/GDQlOuTu5z5eSwOGb6DfXuMDCTlR7pRsO5YbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052